//文章的路由模块
const express = require('express');
const router = express.Router();
const expressJoi = require('@escook/express-joi');

//导入处理函数模块
const article_handler = require('../router_handler/article')
//导入multer和path
const multer = require('multer');
const path = require('path');

// 创建multer实例
const uploads = multer({ dest: path.join(__dirname, '../uploads') });

//导入验证规则
const { add_Article_Schema } = require('../schema/article')

//发布文章
router.post('/add', uploads.single('cover_img'), expressJoi(add_Article_Schema), article_handler.addArticle);

module.exports = router;